package com.delu.controller;


import com.delu.data.Result;
import com.delu.em.ResultEnum;
import com.delu.entity.User;
import com.delu.entity.Vip;
import com.delu.mapper.VipMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * vip表 前端控制器
 * </p>
 *
 * @author 6子的爹
 * @since 2021-12-18
 */
@Controller
@RequestMapping("/vip")
@Api("会员等级表")
public class VipController {

    @Autowired
    private VipMapper vipMapper;

    @GetMapping("selectVipId")
    @ApiOperation(value = "根据会员id查询会员")
    @ApiImplicitParam(name = "vipId",value = "会员id",required = true,paramType = "query")
    public Result selectVipId(@RequestParam("vipId") Long vipId) {
        try {
            Vip vip = vipMapper.selectById(vipId);
            return Result.response(ResultEnum.SUCCESS).setData(vip);
        }catch (Exception e){
            e.printStackTrace();
            return Result.response(ResultEnum.ERROR).setData(e);
        }
    }
}
